﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="WebForm_CodeBehindDataSource.aspx.cs" Inherits="WebAppWalkthrough.WebForm_CodeBehind" %>

<asp:Content ContentPlaceHolderID="HeadContent" runat="server" >
</asp:Content>
<asp:Content ContentPlaceHolderID="MainContent" runat="server">
    <asp:Panel ID="pnlEdit" runat="server" Visible="false">
    <div id="dvEdit">
    <asp:Label id="lblNome" runat="server" Text="Nome:" />
    <asp:TextBox id="txtNome" runat="server" />
    <asp:Label id="lblSobrenome" runat="server" Text="Sobrenome:" />
    <asp:TextBox id="txtSobrenome" runat="server" /><br />
    <asp:Label id="lblCidade" runat="server" Text="Cidade:" />
    <asp:TextBox id="txtCidade" runat="server" />

    <br />
    <asp:Button id="btnSalvar" Text="Salvar" runat="server" onclick="btnSalvar_Click" />

    </div>
    </asp:Panel>
	<asp:GridView ID="ContactsGridView" AutoGenerateColumns="False" runat="server" 
        onrowcommand="ContactsGridView_RowCommand">
		<Columns>
			<asp:TemplateField HeaderText="Nome">
				<ItemTemplate>
					<asp:Label Text='<%# Eval("firstname")%>' runat="server" />
				</ItemTemplate>
			</asp:TemplateField>
			<asp:TemplateField HeaderText="Sobrenome">
				<ItemTemplate>
					<asp:Label Text='<%# Eval("lastname") %>' runat="server" />
				</ItemTemplate>
			</asp:TemplateField>
			<asp:TemplateField HeaderText="Cidade">
				<ItemTemplate>
					<asp:Label Text='<%# Eval("address1_city") %>' runat="server" />
				</ItemTemplate>
			</asp:TemplateField>
		    <asp:TemplateField ShowHeader="False">
                <ItemTemplate>
                    <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" 
                        CommandName="Editar" Text="Editar"></asp:LinkButton>
                </ItemTemplate>
             </asp:TemplateField>
             <asp:TemplateField ShowHeader="False">
                <ItemTemplate>
                    <asp:LinkButton ID="lkbExcluir" runat="server" CausesValidation="False" 
                        CommandName="Excluir" Text="Excluir"></asp:LinkButton>
                </ItemTemplate>
             </asp:TemplateField>
		</Columns>
	</asp:GridView>
</asp:Content>
